//依赖引入
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

//引入页面组件
import 'routers.dart';

//build文件
part 'router.g.dart';

//路由配置
@TypedGoRoute<HomeRoute>(path: '/home')
class HomeRoute extends GoRouteData with _$HomeRoute {
  const HomeRoute();
  @override
  Widget build(BuildContext context, GoRouterState state) => HomeScreen();
}

@TypedGoRoute<LoginRoute>(path: '/login')
class LoginRoute extends GoRouteData with _$LoginRoute {
  const LoginRoute();
  @override
  Widget build(BuildContext context, GoRouterState state) => Login();
}

@TypedGoRoute<LoginPhoneNumberRoute>(path: '/mobileLogin')
class LoginPhoneNumberRoute extends GoRouteData with _$LoginPhoneNumberRoute {
  const LoginPhoneNumberRoute();
  @override
  Widget build(BuildContext context, GoRouterState state) => LoginPhoneNumber();
}

@TypedGoRoute<UserListRoute>(path: '/userlist')
class UserListRoute extends GoRouteData with _$UserListRoute {
  const UserListRoute();
  @override
  Widget build(BuildContext context, GoRouterState state) => UserListPage();
}
